<template>
    <div>

        <p v-for="message in messages">{{ message }}</p>
    </div>
</template>
  
<script setup>
import { ref, onMounted } from 'vue'
const messages = ref([])

const socket = new WebSocket('ws://localhost:8081/websocket/57')
socket.onmessage = (event) => {
    messages.value.push(event.data)
}
onMounted(() => {
    console.log('WebSocket connected!')
})
</script>
  